<template>
	<view class="form-panel">
		<BoxView :titBoxObj="{
		    title: title,
		    titleCount: description
		}" padding="0" style="height: 100%;overflow: hidden;" backgroundColor="#FFFFF4">
			<view class="body" :class="[customBodyClass]">
				<slot></slot>
			</view>
			<view class="footer">
				<button v-for="btn in btns" class="custom-btn" :class="[btn.className]" :key="btn.text" @click="btn.click" :disabled="btn.disabled" :style="{ backgroundImage: `url(${btn.icon})`, color: btn.color }">{{btn.text}}</button>
			</view>
		</BoxView>
	</view>
</template>

<script setup>
import BoxView from "@/components/UiView/BoxView.vue";
const { title, description, btns, customBodyClass } = defineProps(["title", "description", "btns", "customBodyClass"])
</script>

<style scoped lang="scss">
.form-panel {
	position: relative;
	width: 100%;
	height: 100%;
	box-sizing: border-box;
	font-family: Source Han Sans CN, Source Han Sans CN;
	.body {
		height: calc(100% - 80rpx);
		box-sizing: border-box;
		padding: 12rpx 12rpx 0 12rpx;
	}
	.footer {
		display: flex;
		justify-content: center;
		height: 50rpx;
		box-sizing: border-box;
		align-items: center;
		.custom-btn {
		  background-color: transparent !important;
		  border: none !important;
		  border-radius: 0 !important;
		  font-size: inherit !important;
		  font-weight: normal !important;
		  outline: none !important;
		  min-width: 94rpx;
		  height: 28rpx;
		  line-height: 26rpx;
		  background-repeat: no-repeat;
		  background-size: 100% 100%;
		  background-position: center;
		  padding: 0 10rpx;
		  margin: 0 2rpx;
		}
		
		/* 清除微信小程序的 ::after 伪元素 */
		.custom-btn::after {
		  border: none !important;
		}
	}
}
</style>